package com.gxuwz.PangGuangyao.business.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.PangGuangyao.business.dao.SysBorrowDAO;
import com.gxuwz.PangGuangyao.business.entity.SysBorrow;
import com.gxuwz.core.pagination.Result;

@Service("sysBorrowService")
public class SysBorrowServiceImpl implements ISysBorrowService {
	@Autowired
	private SysBorrowDAO sysBorrowDAO;

	@Override
	public Result<SysBorrow> findAll(int page, int row,String logtype) {
		return sysBorrowDAO.find(page, row, logtype);
	}
	
	@Override
	public SysBorrow findById(Integer id) {
		return sysBorrowDAO.get(SysBorrow.class, id);
	}

	@Override
	public void delete(Integer id) {
		sysBorrowDAO.remove(findById(id));		
	}
	
	@Override
	public void add(SysBorrow sysBorrow) {
		sysBorrowDAO.save(sysBorrow);
		
	}

	public void update(Integer id) {
		sysBorrowDAO.update(findById(id));
		
	}



}
